package ch09.test.cn.cvs.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class HelloController extends AbstractController {
    /**
     * hello Spring MVC
     * @return
     * @throws Exception
     */
//    @RequestMapping(value = "/hello")
//    public String hello()throws Exception{
//        System.out.println("Spring MVC框架搭建成功。");
//        return "hello";
//    }

    @Override
    protected ModelAndView handleRequestInternal(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
        System.out.println("Spring MVC框架搭建成功。");
        return new ModelAndView("hello");
    }
}
